/**
 * 表单窗口的mixin
 */

export const FormModalMixin = {
  data () {
    return {
      title: '',
      visible: false,
      confirmLoading: false,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      },
      form: this.$form.createForm(this),
      model: {}
    }
  },
  methods: {
    /**
     * 重置表单数据
     */
    resetFields () {
      this.form.resetFields()
    },
    /**
     * 关闭窗口
     */
    close () {
      this.visible = false
    }
  }
}
